import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'


export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: 'home'
  },
  {
    path: '/home',
    redirect: '/home/app1',
    meta: {
      title: 'APP',
      isShow: true,
      icon: 'Aim'
    },
    children: [
      {
        path: 'app1',
        meta: {
          title: '旧系统',
          isShow: true,
          icon: 'ChatLineSquare'
        },
        component: () => import('@/pages/home/app1.vue')
      },
      {
        path: 'app2',
        meta: {
          title: 'APP产品管理 ',
          isShow: true,
          icon: 'Female'
        },
        component: () => import('@/pages/home/app2.vue')
      },
      {
        path: 'app3',
        meta: {
          title: '投放管理',
          isShow: true,
          icon: 'Odometer'
        },
        component: () => import('@/pages/home/app3.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  // 滚动行为 控制滚动条的位置
  scrollBehavior() {
    return {
      left: 0,
      top: 0
    }
  }
})

export default router